-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: implementation of variance for halfnormal distribution
#9636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat: implementation of variance for halfnormal distribution
#9636
Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
Planeshifter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR!
lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.native.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.native.js
Show resolved
Hide resolved
lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json
Show resolved
Hide resolved
lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.native.js
Show resolved
Hide resolved
lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/examples/index.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/examples/c/example.c
Outdated
Show resolved
Hide resolved
Planeshifter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be close to merging.
| - **mu**: `[in] double` mean. | ||
| - **lambda**: `[in] double` shape parameter. | ||
| - **sigma**: `[in] double` scale parameter. | ||
| - **return**: `[out] double` variance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return value shouldn't be listed as an argument here; we only list the input parameters. The return type is already shown in the function signature below.
|
|
||
| tape( 'if provided `NaN`, the function returns `NaN`', opts, function test( t ) { | ||
| var y = variance( NaN ); | ||
| t.strictEqual( isnan( y ), true, 'returns NaN' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assertion message should be 'returns expected value' for consistency with other packages and with test.js.
| t.strictEqual( isnan( y ), true, 'returns NaN' ); | |
| t.strictEqual( isnan( y ), true, 'returns expected value' ); |
| var y; | ||
|
|
||
| y = variance( 0.0 ); | ||
| t.strictEqual( isnan( y ), true, 'returns NaN' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here - let's use 'returns expected value' for consistency.
| t.strictEqual( isnan( y ), true, 'returns NaN' ); | |
| t.strictEqual( isnan( y ), true, 'returns expected value' ); |
| t.strictEqual( isnan( y ), true, 'returns NaN' ); | ||
|
|
||
| y = variance( -1.0 ); | ||
| t.strictEqual( isnan( y ), true, 'returns NaN' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
| t.strictEqual( isnan( y ), true, 'returns NaN' ); | |
| t.strictEqual( isnan( y ), true, 'returns expected value' ); |
Progresses: #9416
Description
This pull request:
Related Issues
This pull request has the following related issues:
@stdlib/stats/base/dists/halfnormalpackage #9416Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
{{TODO: add disclosure if applicable}}
@stdlib-js/reviewers